class UserController < ApplicationController
  layout 'no_login'
  skip_before_action :require_login, only: [:new, :create]

  def new
    @user = User.new unless @user
  end

  def create
    @user = User.new(params[:user])
    if @user.save
      redirect_to '/login'
    else
      p @user.errors
      render 'new'
    end
  end
end
